package com.yv.websocket.controller.v1;

import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

import com.yv.websocket.model.InMessage;
import com.yv.websocket.model.OutMessage;

/*
 * @SendTo
 */
@Controller
public class GameInfoController {

	//页面访问localhost:8080/v1/index.html   和localhost:8080/v1/admin.html
	@MessageMapping("/v1/chat")
	@SendTo("/topic/game_chat")  //e.g JS: stompClient.subscribe('/topic/game_chat', function (result) {}
	public OutMessage gameInfo(InMessage message){
		
		return new OutMessage(message.getContent());
	}


}



